{% extends "html/base_template.html" %}
{% block content_section %}
    {% if not cp or cp.status == 0 %}
        <div id="id_account_info">
            {% if not cp %}
                <div class="row">
                    <div class="my_blockquote">
                        <p>
                            <strong>完善账户信息</strong>
                        </p>
                        <p>初次登录,请完善账户信息,通过审核后方可继续游戏上传</p>
                    </div>
                </div>
            {% endif %}
            <div class="row">
                <script type="text/javascript">
                    submit_account_form();
                </script>
                <div class="col-sm-12">
                    <div class="panel panel-default">
                        <form id="id_account_form" role="form" enctype="multipart/form-data"
                              class="form-horizontal"
                              method="post" action="/APKManager/upload_cpinfo">
                            {% csrf_token %}
                            <div class="panel-heading">
                                <h3 class="panel-title">公司信息<i class="h3_span1">请确保公司信息与合同中信息一致</i>
                                </h3>
                            </div>
                            <div class="panel-body">
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><i
                                            class="cl_red">*</i>公司名称</label>
                                    <div class="col-sm-10">
                                        <input type="text" class="form-control" name="company"
                                               value="{{ cp.company }}">
                                        <p class="cl_red" style="display:none;">请填写正确的名称</p>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><i
                                            class="cl_red">*</i>法人</label>
                                    <div class="col-sm-10">
                                        <input type="text" class="form-control"
                                               name="representative"
                                               value="{{ cp.representative }}">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><i class="cl_red">*</i>公司注册地址</label>
                                    <div class="col-sm-10">
                                        <input type="text" class="form-control" name="regaddr"
                                               value="{{ cp.regaddr }}">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><i
                                            class="cl_red">*</i>邮编</label>
                                    <div class="col-sm-10">
                                        <input type="text" class="form-control" name="postcode"
                                               value="{{ cp.postcode }}">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><i class="cl_red">*</i>公司所在地址</label>
                                    <div class="col-sm-10">
                                         <input type="text" class="form-control" name="region"
                                               value="{{ cp.region }}">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><i
                                            class="cl_red">*</i>营业执照</label>
                                    <div class="col-sm-10">
                                        <input type="file" class="form-control" name="license"
                                               id="id_license">
                                        <p>最新年检的营业执照副本扫描件，JPG,PNG,GIF格式的图片</p>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">税务登记证</label>
                                    <div class="col-sm-10">
                                        <input type="file" class="form-control" name="tax_reg_ca"
                                               id="id_taxregcert">
                                        <p>若还未三证合一，请提交税务登记证扫描件，jpg、png、gif格式的图片</p>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">银行开户许可证</label>
                                    <div class="col-sm-10">
                                        <input type="file" class="form-control" name="bank_license"
                                               id="id_bank_account_license">
                                        <p>若还未三证合一，请提交银行开户许可证扫描件，jpg、png、gif格式的图片</p>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">其他材料</label>
                                    <div class="col-sm-10">
                                        <input type="file" class="form-control" name="others"
                                               id="id_others">
                                        <p>若协议中有其他约定，请提交相关材料，支持上传zip包</p>
                                    </div>
                                </div>
                            </div>
                            <div class="panel-heading">
                                <h3 class="panel-title">财务信息<i class="h3_span1">请确保信息真实有效</i></h3>
                            </div>
                            <div class="panel-body">
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><i
                                            class="cl_red">*</i>银行名称</label>
                                    <div class="col-sm-10">
                                        <input type="text" class="form-control"
                                               name="bank_account_name"
                                               value="{{ cp.bank_account_name }}">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><i
                                            class="cl_red">*</i>开户银行</label>
                                    <div class="col-sm-10">
                                        <select class="form-control" name="bank_name">
                                            <option>请选择银行</option>
                                            {% for bank, name in Bank.Banks %}
                                                {% if cp.bank_name == bank %}
                                                    <option value="{{ bank }}" selected="selected">{{ name }}</option>
                                                {% else %}
                                                    <option value="{{ bank }}">{{ name }}</option>
                                                {% endif %}
                                            {% endfor %}
                                        </select>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><i
                                            class="cl_red">*</i>银行帐户</label>
                                    <div class="col-sm-10">
                                        <input type="text" class="form-control" name="bank_account"
                                               value="{{ cp.bank_account }}">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><i class="cl_red">*</i>纳税人识别号</label>
                                    <div class="col-sm-10">
                                        <input type="text" class="form-control"
                                               name="taxpayerid"
                                               value="{{ cp.taxpayerid }}">
                                    </div>
                                </div>
                            </div>
                            <div class="panel-heading">
                                <h3 class="panel-title">联系人信息</h3>
                            </div>
                            <div class="panel-body">
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><i class="cl_red">*</i>业务接口人姓名</label>
                                    <div class="col-sm-10">
                                        <input type="text" class="form-control" name="bus_inf_name"
                                               value="{{ cp.busi_manager }}">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><i
                                            class="cl_red">*</i>联系电话</label>
                                    <div class="col-sm-10">
                                        <input type="text" class="form-control"
                                               name="bus_telephone_no"
                                               value="{{ cp.busi_phoneno }}">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><i
                                            class="cl_red">*</i>邮箱</label>
                                    <div class="col-sm-10">
                                        <input type="text" class="form-control" name="bus_mail"
                                               value="{{ cp.busi_mail }}">
                                    </div>
                                </div>
                                <div class="form-group-separator"></div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><i class="cl_red">*</i>技术接口人姓名</label>
                                    <div class="col-sm-10">
                                        <input type="text" class="form-control" name="eng_inf_name"
                                               value="{{ cp.tech_manager }}">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><i
                                            class="cl_red">*</i>联系电话</label>
                                    <div class="col-sm-10">
                                        <input type="text" class="form-control"
                                               name="eng_telephone_no"
                                               value="{{ cp.tech_phoneno }}">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><i
                                            class="cl_red">*</i>邮箱</label>
                                    <div class="col-sm-10">
                                        <input type="text" class="form-control" name="eng_mail"
                                               value="{{ cp.tech_mail }}">
                                    </div>
                                </div>
                            </div>
                            <div class="my_button">
                                <button type="submit" class="btn btn-info btn-block my_btn_01">提交审核
                                </button>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    {% elif cp.status == 1 %}
        <div class="row">
            <div class="col-sm-12">
                <div class="panel submit_return">
                    <div>
                        <h3>信息已提交，我们将在5个工作日内完成审核</h3>
                        <p>审核结果将以邮件形式进行通知，请业务接口人及时查收<br/>通过审核后即可进行上传游戏操作</p>
                    </div>
                </div>
            </div>
        </div>
    {% elif cp.status == -1 %}
        <div>
            <div class="row">
        <div class="my_blockquote">
            <p>
                <strong>未通过审核</strong>
            </p>
            <p>您提交的资质审核未通过，请根据下列问题进行重新编辑：
                <span class="cl_red">{{ cp.result_desc }}</span>
        </div>
    </div>
            <div class="row">
        <div class="col-sm-12">
            <div class="panel panel-default">
                <form id="id_account_form" role="form" enctype="multipart/form-data"
                      class="form-horizontal"
                      method="post" action="/APKManager/cp/handler/submit_account">
                    {% csrf_token %}
                    <div class="panel-heading">
                        <h3 class="panel-title">公司信息<i class="h3_span1">请确保公司信息与合同中信息一致</i></h3>
                    </div>
                    <div class="panel-body">
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><i
                                    class="cl_red">*</i>公司名称</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" name="company"
                                       value="{{ cp.company }}">
                                <p class="cl_red" style="display:none;">请填写正确的名称</p>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><i class="cl_red">*</i>法人</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" name="representative"
                                       value="{{ cp.representative }}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><i
                                    class="cl_red">*</i>公司注册地址</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" name="reg_address"
                                       value="{{ cp.regaddr }}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><i class="cl_red">*</i>邮编</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" name="postcode"
                                       value="{{ cp.postcode }}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><i
                                    class="cl_red">*</i>公司所在省市</label>
                            <div class="col-sm-10">
                                <select class="form-control" style=" margin-bottom:10px;"
                                        name="province" value="{{ cp.province }}">
                                    <option>请选择省</option>
                                    {% for index, name in provinces %}
                                        <option value="{{ index }}">{{ name }}</option>
                                    {% endfor %}
                                </select>
                                <select class="form-control" name="city" id="id_select_city"
                                        value="{{ cp.city }}">
                                    <option>请选择市</option>
                                    {% for index,name in cities %}
                                        <option value="{{ index }}">{{ name }}</option>
                                    {% endfor %}
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><i
                                    class="cl_red">*</i>营业执照</label>
                            <div class="col-sm-10">
                                <input type="file" class="form-control" name="license"
                                       id="id_license">
                                <p>最新年检的营业执照副本扫描件，JPG,PNG,GIF格式的图片</p>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">税务登记证</label>
                            <div class="col-sm-10">
                                <input type="file" class="form-control" name="tax_reg_ca"
                                       id="id_taxregcert">
                                <p>若还未三证合一，请提交税务登记证扫描件，jpg、png、gif格式的图片</p>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">银行开户许可证</label>
                            <div class="col-sm-10">
                                <input type="file" class="form-control" name="bank_license"
                                       id="id_bank_account_license">
                                <p>若还未三证合一，请提交银行开户许可证扫描件，jpg、png、gif格式的图片</p>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">其他材料</label>
                            <div class="col-sm-10">
                                <input type="file" class="form-control" name="others"
                                       id="id_others">
                                <p>若协议中有其他约定，请提交相关材料，支持上传zip包</p>
                            </div>
                        </div>
                    </div>
                    <div class="panel-heading">
                        <h3 class="panel-title">财务信息<i class="h3_span1">请确保信息真实有效</i></h3>
                    </div>
                    <div class="panel-body">
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><i
                                    class="cl_red">*</i>银行名称</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" name="bank_account_name"
                                       value="{{ cp.bank_account_name }}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><i
                                    class="cl_red">*</i>开户银行</label>
                            <div class="col-sm-10">
                                <select class="form-control" name="bank_name"
                                        value="{{ cp.bank_name }}">
                                    <option>请选择银行</option>
                                    {% for index, name in banks %}
                                        <option value="{{ index }}">{{ name }}</option>
                                    {% endfor %}
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><i
                                    class="cl_red">*</i>银行帐户</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" name="bank_account"
                                       value="{{ cp.bank_account }}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><i
                                    class="cl_red">*</i>纳税人识别号</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" name="taxpayer_id_no"
                                       value="{{ cp.taxpayerid }}">
                            </div>
                        </div>
                    </div>
                    <div class="panel-heading">
                        <h3 class="panel-title">联系人信息</h3>
                    </div>
                    <div class="panel-body">
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><i
                                    class="cl_red">*</i>业务接口人姓名</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" name="bus_inf_name"
                                       value="{{ cp.busi_manager }}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><i
                                    class="cl_red">*</i>联系电话</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" name="bus_telephone_no"
                                       value="{{ cp.busi_phoneno }}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><i class="cl_red">*</i>邮箱</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" name="bus_mail"
                                       value="{{ cp.busi_mail }}">
                            </div>
                        </div>
                        <div class="form-group-separator"></div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><i
                                    class="cl_red">*</i>技术接口人姓名</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" name="eng_inf_name"
                                       value="{{ cp.tech_manager }}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><i
                                    class="cl_red">*</i>联系电话</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" name="eng_telephone_no"
                                       value="{{ cp.tech_phoneno }}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><i class="cl_red">*</i>邮箱</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" name="eng_mail"
                                       value="{{ cp.tech_mail }}">
                            </div>
                        </div>
                    </div>
                    <div class="my_button">
                        <button type="submit" class="btn btn-info btn-block my_btn_01">提交审核</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
        </div>
    {% elif cp.status == 2 %}
        <div class="row">
            <div class="col-sm-12">
                <div class="panel panel-default">
                    <form role="form" class="form-horizontal form_no">
                        <div class="panel-heading">
                            <h3 class="panel-title">公司信息<i class="h3_span1">请确保公司信息与合同中信息一致</i></h3>
                        </div>
                        <div class="panel-body">
                            <div class="form-group">
                                <label class="col-sm-2 control-label"><i
                                        class="cl_red">*</i>公司名称</label>
                                <div class="col-sm-10">
                                    <div class="inp_val">{{ cp.company }}</div>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label"><i
                                        class="cl_red">*</i>法人</label>
                                <div class="col-sm-10">
                                    <div class="inp_val">{{ cp.representative }}</div>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label"><i
                                        class="cl_red">*</i>公司注册地址</label>
                                <div class="col-sm-10">
                                    <div class="inp_val">{{ cp.regaddr }}</div>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label"><i
                                        class="cl_red">*</i>邮编</label>
                                <div class="col-sm-10">
                                    <div class="inp_val">{{ cp.postcode }}</div>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label"><i
                                        class="cl_red">*</i>公司所在地址</label>
                                <div class="col-sm-10">
                                    <div class="inp_val">{{ cp.region }}</div>
                                </div>
                            </div>
                        {% load staticfiles %}
                            <div class="form-group">
                                <label class="col-sm-2 control-label"><i
                                        class="cl_red">*</i>营业执照</label>
                                <div class="col-sm-10">
                                    <div class="file_img"><img
                                            src="{% static "images" %}/{{ cp.license.name }}"/><a
                                            href="#">点击查看大图</a></div>
                                </div>
                            </div>
                            {#                        <div class="form-group">#}
                            {#                            <label class="col-sm-2 control-label"><i#}
                            {#                                    class="cl_red">*</i>营业执照</label>#}
                            {#                            <div class="col-sm-10">#}
                            {#                                <div class="inp_val"><a href="#">下载</a></div>#}
                            {#                            </div>#}
                            {#                        </div>#}
                            <div class="form-group">
                                <label class="col-sm-2 control-label">税务登记证</label>
                                <div class="col-sm-10">
                                    {% if cp.taxregcert.name != '' %}
                                        <div class="file_img"><img
                                                src="{{ download_res_url }}/{{ cp.taxregcert.name }}"/><a
                                                href="#">点击查看大图</a></div>
                                    {% else %}
                                        <div class="file_img"><img src=""/><a href="#">点击查看大图</a>
                                        </div>
                                    {% endif %}
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">银行开户许可证</label>
                                <div class="col-sm-10">
                                    {% if cp.bank_license.name != '' %}
                                        <div class="file_img"><img
                                                src="{{ download_res_url }}/{{ cp.bank_license.name }} "/><a
                                                href="#">点击查看大图</a></div>
                                    {% else %}
                                        <div class="file_img"><img src=""/><a href="#">点击查看大图</a>
                                        </div>
                                    {% endif %}
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">其他材料</label>
                                <div class="col-sm-10">
                                    <div class="inp_val">
                                        {% if cp.others.name != '' %}
                                            <a href="{{ download_res_url }}/{{ cp.others.name }}">点击下载</a>
                                        {% else %}
                                            <a href="{{ download_res_url }}/{{ cp.others.name }}">无</a>
                                        {% endif %}
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="panel-heading">
                            <h3 class="panel-title">财务信息<i class="h3_span1">请确保信息真实有效</i></h3>
                        </div>
                        <div class="panel-body">
                            <div class="form-group">
                                <label class="col-sm-2 control-label"><i
                                        class="cl_red">*</i>银行名称</label>
                                <div class="col-sm-10">
                                    <div class="inp_val">{{ cp.bank_account_name }}</div>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label"><i
                                        class="cl_red">*</i>开户银行</label>
                                <div class="col-sm-10">
                                    <div class="inp_val">{{ cp.bank_name }}</div>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label"><i
                                        class="cl_red">*</i>银行帐户</label>
                                <div class="col-sm-10">
                                    <div class="inp_val">{{ cp.bank_account }}</div>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label"><i
                                        class="cl_red">*</i>纳税人识别号</label>
                                <div class="col-sm-10">
                                    <div class="inp_val">{{ cp.taxpayerid }}</div>
                                </div>
                            </div>
                        </div>
                        <div class="panel-heading">
                            <h3 class="panel-title">联系人信息</h3>
                        </div>
                        <div class="panel-body">
                            <div class="form-group">
                                <label class="col-sm-2 control-label"><i
                                        class="cl_red">*</i>业务接口人姓名</label>
                                <div class="col-sm-10">
                                    <div class="inp_val">{{ cp.bus_inf_name }}</div>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label"><i
                                        class="cl_red">*</i>联系电话</label>
                                <div class="col-sm-10">
                                    <div class="inp_val">{{ cp.bus_telephone_no }}</div>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label"><i
                                        class="cl_red">*</i>邮箱</label>
                                <div class="col-sm-10">
                                    <div class="inp_val">{{ cp.bus_mail }}
                                    </div>
                                </div>
                            </div>
                            <div class="form-group-separator"></div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label"><i
                                        class="cl_red">*</i>技术接口人姓名</label>
                                <div class="col-sm-10">
                                    <div class="inp_val">{{ cp.eng_inf_name }}</div>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label"><i
                                        class="cl_red">*</i>联系电话</label>
                                <div class="col-sm-10">
                                    <div class="inp_val">{{ cp.eng_telephone_no }}</div>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label"><i
                                        class="cl_red">*</i>邮箱</label>
                                <div class="col-sm-10">
                                    <div class="inp_val">{{ cp.eng_mail }}</div>
                                </div>
                            </div>
                        </div>
                        {#            </div>#}
                    </form>
                </div>
            </div>
        </div>
    {% endif %}
{% endblock %}